export type AppState = {
    version: string,
    appInfo: any,
    platform: string,
    menuButtonInfo: any,
    statusBarHeight: string | number,
}

export const state: AppState = {
    version: uni.getStorageSync('version') || '999.999.999',
    appInfo: uni.getSystemInfoSync(),
    platform: 'ios',
    // #ifdef MP-WEIXIN
    menuButtonInfo: uni.getMenuButtonBoundingClientRect(),
    // #endif
    statusBarHeight: 0,
};

export const getters = {
    version: (state: AppState) => state.version,
    appInfo: (state: AppState) => state.appInfo,
    platform: (state: AppState) => state.platform,
    menuButtonInfo: (state: AppState) => state.menuButtonInfo,
    statusBarHeight: (state: AppState) => state.statusBarHeight,
}
